import re
import requests
import sys
import warnings
warnings.filterwarnings("ignore")


def poc(target):
    try:
        response = requests.get(url=target, timeout=3, verify=False)
        title = re.findall("<title>(.*?)</title>", response.text)[0]
        if title == 'Swagger UI':
            print(response.url)  # 打印重定向后的网址
            # 返回重定向后的网址
            return response.url
    except Exception as e:
        pass
    return False

target = sys.argv[1]

poc(target)